using UnityEngine;
using UnityEngine.UI;

namespace Voodoo.Sauce.Internal.GDPR.UI
{
	public class ColorElement : MonoBehaviour
	{
		private Text _text;

		private Image _image;

		private SimpleCheckbox _checkbox;

		private void Awake()
		{
			_text = GetComponent<Text>();
			_image = GetComponent<Image>();
			_checkbox = GetComponent<SimpleCheckbox>();
		}

		public void SetColor(Color color)
		{
			if (_text != null)
			{
				_text.color = color;
			}
			if (_image != null)
			{
				_image.color = color;
			}
			if (_checkbox != null)
			{
				_checkbox.SetDefaultColor(color);
			}
		}
	}
}
